using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._General
{
    /// <summary>
    /// <para>Sort</para>
    /// <para>Reorders records in a feature class or table, in ascending or descending order, based on one or multiple fields. The reordered result is written to a new dataset.</para>
    /// <para>根据一个或多个字段按升序或降序对要素类或表中的记录进行重新排序。重新排序的结果将写入新数据集。</para>
    /// </summary>    
    [DisplayName("Sort")]
    public class Sort : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Sort()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_dataset">
        /// <para>Input Dataset</para>
        /// <para>The input dataset whose records will be reordered based on the field values in the sort field or fields.</para>
        /// <para>输入数据集，其记录将根据一个或多个排序字段中的字段值重新排序。</para>
        /// </param>
        /// <param name="_out_dataset">
        /// <para>Output Dataset</para>
        /// <para>The output feature class or table.</para>
        /// <para>输出要素类或表。</para>
        /// </param>
        /// <param name="_sort_field">
        /// <para>Field(s)</para>
        /// <para><xdoc>
        ///   <para>Specifies the field or fields whose values will be used to reorder the input records and the direction the records will be sorted.</para>
        ///   <para>Sorting by the Shape field or by multiple fields is only available with an Desktop Advanced license. Sorting by any single attribute field (excluding Shape) is available at all license levels.</para>
        ///   <bulletList>
        ///     <bullet_item>Ascending—Records are sorted from low value to high value.</bullet_item><para/>
        ///     <bullet_item>Descending—Records are sorted from high value to low value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定其值将用于对输入记录进行重新排序的一个或多个字段以及记录的排序方向。</para>
        ///   <para>按“形状”字段或多个字段排序仅适用于 Desktop Advanced 许可证。按任何单个属性字段（不包括形状）排序适用于所有许可证级别。</para>
        ///   <bulletList>
        ///     <bullet_item>升序 - 记录按从低值到高值排序。</bullet_item><para/>
        ///     <bullet_item>降序 - 记录按高值到低值的顺序排序。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public Sort(object _in_dataset, object _out_dataset, object _sort_field)
        {
            this._in_dataset = _in_dataset;
            this._out_dataset = _out_dataset;
            this._sort_field = _sort_field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Sort";

        public override string CallName => "management.Sort";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "extent", "geographicTransformations", "maintainAttachments", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "qualifiedFieldNames", "scratchWorkspace", "transferGDBAttributeProperties", "workspace"];

        public override object[] ParameterInfo => [_in_dataset, _out_dataset, _sort_field, _spatial_sort_method.GetGPValue()];

        /// <summary>
        /// <para>Input Dataset</para>
        /// <para>The input dataset whose records will be reordered based on the field values in the sort field or fields.</para>
        /// <para>输入数据集，其记录将根据一个或多个排序字段中的字段值重新排序。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_dataset { get; set; }


        /// <summary>
        /// <para>Output Dataset</para>
        /// <para>The output feature class or table.</para>
        /// <para>输出要素类或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_dataset { get; set; }


        /// <summary>
        /// <para>Field(s)</para>
        /// <para><xdoc>
        ///   <para>Specifies the field or fields whose values will be used to reorder the input records and the direction the records will be sorted.</para>
        ///   <para>Sorting by the Shape field or by multiple fields is only available with an Desktop Advanced license. Sorting by any single attribute field (excluding Shape) is available at all license levels.</para>
        ///   <bulletList>
        ///     <bullet_item>Ascending—Records are sorted from low value to high value.</bullet_item><para/>
        ///     <bullet_item>Descending—Records are sorted from high value to low value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定其值将用于对输入记录进行重新排序的一个或多个字段以及记录的排序方向。</para>
        ///   <para>按“形状”字段或多个字段排序仅适用于 Desktop Advanced 许可证。按任何单个属性字段（不包括形状）排序适用于所有许可证级别。</para>
        ///   <bulletList>
        ///     <bullet_item>升序 - 记录按从低值到高值排序。</bullet_item><para/>
        ///     <bullet_item>降序 - 记录按高值到低值的顺序排序。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field(s)")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _sort_field { get; set; }


        /// <summary>
        /// <para>Spatial Sort Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how features are spatially sorted. The sort method is only enabled when the Shape field is selected as one of the sort fields.</para>
        ///   <bulletList>
        ///     <bullet_item>Upper right—Sorting starts at the upper right corner. This is the default.</bullet_item><para/>
        ///     <bullet_item>Upper left—Sorting starts at the upper left corner.</bullet_item><para/>
        ///     <bullet_item>Lower right—Sorting starts at the lower right corner.</bullet_item><para/>
        ///     <bullet_item>Lower left—Sorting starts at the lower left corner.</bullet_item><para/>
        ///     <bullet_item>Peano curve—Sorting uses a space filling curve algorithm, also known as a Peano curve.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要素的空间排序方式。仅当选择“形状”字段作为排序字段之一时，才会启用排序方法。</para>
        ///   <bulletList>
        ///     <bullet_item>右上角 - 从右上角开始排序。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>左上角 - 从左上角开始排序。</bullet_item><para/>
        ///     <bullet_item>右下角 - 从右下角开始排序。</bullet_item><para/>
        ///     <bullet_item>左下角 - 从左下角开始排序。</bullet_item><para/>
        ///     <bullet_item>皮亚诺曲线 - 排序使用空间填充曲线算法，也称为皮亚诺曲线。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Spatial Sort Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _spatial_sort_method_value _spatial_sort_method { get; set; } = _spatial_sort_method_value._UR;

        public enum _spatial_sort_method_value
        {
            /// <summary>
            /// <para>Upper left</para>
            /// <para>Upper left—Sorting starts at the upper left corner.</para>
            /// <para>左上角 - 从左上角开始排序。</para>
            /// </summary>
            [Description("Upper left")]
            [GPEnumValue("UL")]
            _UL,

            /// <summary>
            /// <para>Upper right</para>
            /// <para>Upper right—Sorting starts at the upper right corner. This is the default.</para>
            /// <para>右上角 - 从右上角开始排序。这是默认设置。</para>
            /// </summary>
            [Description("Upper right")]
            [GPEnumValue("UR")]
            _UR,

            /// <summary>
            /// <para>Lower left</para>
            /// <para>Lower left—Sorting starts at the lower left corner.</para>
            /// <para>左下角 - 从左下角开始排序。</para>
            /// </summary>
            [Description("Lower left")]
            [GPEnumValue("LL")]
            _LL,

            /// <summary>
            /// <para>Lower right</para>
            /// <para>Lower right—Sorting starts at the lower right corner.</para>
            /// <para>右下角 - 从右下角开始排序。</para>
            /// </summary>
            [Description("Lower right")]
            [GPEnumValue("LR")]
            _LR,

            /// <summary>
            /// <para>Peano curve</para>
            /// <para>Peano curve—Sorting uses a space filling curve algorithm, also known as a Peano curve.</para>
            /// <para>皮亚诺曲线 - 排序使用空间填充曲线算法，也称为皮亚诺曲线。</para>
            /// </summary>
            [Description("Peano curve")]
            [GPEnumValue("PEANO")]
            _PEANO,

        }

        public Sort SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, bool? qualifiedFieldNames = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, qualifiedFieldNames: qualifiedFieldNames, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}